#include <myheader.h>

/* Usage:  */
int main(int argc, char *argv[]){                                  
    char*ip="192.168.74.128";
    char*port="8080";
    int socket_fd=socket(AF_INET,SOCK_STREAM,0);
    struct sockaddr_in sock;
    sock.sin_family=AF_INET;
    sock.sin_port=htons(atoi(port));
    sock.sin_addr.s_addr=inet_addr(ip);

    bind(socket_fd,(struct sockaddr*)&sock,sizeof(sock));
    listen(socket_fd,10);
    int list[100]={0};
    int size=0;
    while(1){
    fd_set set;
    FD_ZERO(&set);
    FD_SET(STDIN_FILENO,&set);
    select(socket_fd+1,&set,NULL,NULL,NULL);;
    if(FD_ISSET(socket_fd,&set)){
       int net_fd=accept(socket_fd,NULL,NULL);
       list[size]=net_fd;
       size++;
       FD_SET(net_fd,&set);

    }
    }

    close(socket_fd);

    return 0;
}

